package com.hongning.railway.ui.main.fragments.cadremanagement;

import android.arch.lifecycle.ViewModelProviders;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import com.hongning.railway.R;
import com.hongning.railway.app.AppViewModelFactory;
import com.hongning.railway.databinding.FragmentCadremanagementrosterlistBinding;
import com.hongning.railway.entity.reqbean.MettingMessageBean;
import com.hongning.railway.ui.main.fragments.college.CollegeLearnFragment;
import com.hongning.railway.ui.main.fragments.threesessionsandonelesson.ThreesessionSanDoneLessonMsgViewModel;
import com.hongning.railway.util.Apputils;

import me.goldze.mvvmhabit.BR;
import me.goldze.mvvmhabit.base.BaseFragment;

public class CadreManagementRosterListFragment  extends BaseFragment<FragmentCadremanagementrosterlistBinding,CadreManagementRosterListViewModel> {
    public static CadreManagementRosterListFragment newInstance() {

        Bundle args = new Bundle();

        CadreManagementRosterListFragment fragment = new CadreManagementRosterListFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public int initContentView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return R.layout.fragment_cadremanagementrosterlist;
    }

    @Override
    public int initVariableId() {
        return BR.cadremanagentRosterListViewModel;
    }

    @Override
    public void initData() {
        super.initData();
        MettingMessageBean mettingMessageBean=new MettingMessageBean();
        mettingMessageBean.setPagenum(String.valueOf(1));
        mettingMessageBean.setStaffid(Apputils.getStaffid());
        mettingMessageBean.setPagesize("10000");
        viewModel.initDatas(mettingMessageBean);
    }

    @Override
    public CadreManagementRosterListViewModel initViewModel() {
        AppViewModelFactory appViewModelFactory = AppViewModelFactory.getInstance(getActivity().getApplication());
        return ViewModelProviders.of(this,appViewModelFactory).get(CadreManagementRosterListViewModel.class);
    }
}
